package com.huixue.cn.ztej.utils.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.huixue.cn.ztej.enums.OrderRule;


/**
 * Represents a definition of database column
 * 
 * @author mxf
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD,ElementType.FIELD})
public @interface ColumnDefination {

	/**
	 * column name
	 * @return
	 */
	public String column();

	/**
	 * data type
	 * @return
	 */
	public String type();

	/**
	 * column options
	 * @return
	 */
	public String options() default "";
	
	/**
	 * 是否主键
	 * @return
	 */
	public boolean primary() default false;
	
	/**
	 * 是否排序字段
	 * @return
	 */
	public boolean orderBy() default false;

	/**
	 * 排序规则
	 * @return
	 */
	public OrderRule orderRule() default OrderRule.desc;
}
